package com.youlin.dto.res;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.youlin.entities.BygFarewellHall;
import com.youlin.mybean.ResMapping;
import com.youlin.mybean.SetSubList;
import com.youlin.mybean.SetSubProp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

@NoArgsConstructor
@Data
@Accessors(chain=true)
public class AppointmentResDto {

    @ApiModelProperty(value="预约ID")
    private Integer id;

    @ApiModelProperty(value = "告别厅ID", hidden = true)
    private Integer fhId;

    @ApiModelProperty(value="告别厅")
    private BygFarewellHall fh;

    @JsonIgnore
    @ApiModelProperty(value="告别会创建时间", dataType = "java.lang.String", example = "2020-02-02 08:08:08", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value="告别会创建日期", dataType = "java.lang.String", example = "2020-02-02")
    private LocalDate createDate;

    public LocalDate getCreateDate() {
        return createTime.toLocalDate();
    }

    @ApiModelProperty(value="告别厅预约使用日期", dataType = "java.lang.String", example = "2020-02-02")
    private LocalDate useDate;

    @ApiModelProperty(value="告别厅预约使用开始时间", dataType = "java.lang.String", example = "08:08:08")
    private LocalTime startTime;

    @ApiModelProperty(value="告别厅预约使用结束时间", dataType = "java.lang.String", example = "08:08:08")
    private LocalTime endTime;

    @ApiModelProperty(value="告别会状态：0-新建、1-已预约、2-待审核、3-审核中、4-已审核")
    private Integer status;

    @ApiModelProperty(value="预约UUID")
    private String uuId;

    @ApiModelProperty(value="微信二维码url")
    private String wxAcodeUrl;

    @ApiModelProperty(value="大海报url")
    private String posterUrl;

    @JsonIgnore
    @ApiModelProperty(value = "逝者ID", hidden = true)
    private Integer dmId;

    @ApiModelProperty(value="逝者信息")
    @ResMapping(mappingClass = "com.youlin.entities.BygDeadMan")
    private DMListResDto deadMan;

    @ApiModelProperty(value="承办人集合")

    @SetSubList(subClass = "com.youlin.dto.res.TakerResDto")
    private List<TakerResDto> undertakers;

    @ApiModelProperty(value="操作者编码")
    private Integer operatorId;

    @SetSubProp(subProp = "name", subClass = "com.youlin.entities.BygAdmin", primaryKey = "operatorId", subPrimaryKey = "id")
    @ApiModelProperty(value="操作者编码")
    private String operatorName;

    @SetSubProp(subProp = "nick", subClass = "com.youlin.entities.BygAdmin", primaryKey = "operatorId", subPrimaryKey = "id")
    @ApiModelProperty(value="操作者姓名")
    private String operatornick;

    @ApiModelProperty(value="审核者ID")
    private Integer reviewerId;

    @SetSubProp(subProp = "name", subClass = "com.youlin.entities.BygAdmin", primaryKey = "reviewerId", subPrimaryKey = "id")
    @ApiModelProperty(value="审核者编码")
    private String reviewerName;

    @SetSubProp(subProp = "nick", subClass = "com.youlin.entities.BygAdmin", primaryKey = "reviewerId", subPrimaryKey = "id")
    @ApiModelProperty(value="审核者姓名")
    private String reviewerNick;

}

